package com.cskaoyan.javase.exception._1handle._4throw;

/**
 * @description: 空接口的作用
 * @author: wuguidong@cskaoyan.onaliyun.com
 **/

public class Demo3 {
    public static void main(String[] args) {
        Person p = new Person();
        try {
            judge(p);
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }

        System.out.println("after");
    }

    public static void judge(Object o) throws CloneNotSupportedException {
        if (o instanceof Cloneable) System.out.println("允许克隆,没有问题");
        else throw new CloneNotSupportedException("禁止克隆");
    }
}
interface Cloneable{}

class Person implements Cloneable{}
